<script>
export default {
  name: "actionOwner",
  computed: {
    //指定action的列表模型，可在混合组件中重写改方法来定位
    actionModel() {
      if (this.model && this.model.actions) {
        return this.model.actions;
      } else {
        return [];
      }
    }
  },
  data() {
    return {
      actionOwner: true,
      collectionCode: "actions"
    };
  },
  beforeCreate() {
    //将action的既定store混入当前组件的storeModule中
    //设置 _action_mixins 记性标记防止重复混入
    //尝试寻找上级
    var upAction = this;
    while (upAction.$parent) {
      if (upAction.action) {
        this.$upAction = upAction;
        break;
      } else {
        upAction = upAction.$parent;
      }
    }
  },
  mounted() {
    this.$actionCollection = this.$refs[this.actionCollectionCode];
  },
  methods: {
    actionCall() {}
  }
};
</script>
